<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 获取URL参数, 并转换为对象类型 -->
    <script>
      //获取访问路径
      var a = 'http://item.taobao.com/item.htm?a=1&b=2&c=&d=shmhm'
      var result = a.replace(/&/g, '","').replace(/=/g, '":"')
      console.log(result)
      var reqDataString = '{"' + result + '"}'
      console.log(reqDataString)
      var valueRe = JSON.parse(reqDataString)
      console.log(valueRe)
    </script>
  </body>
</html>
